package thread;


//工厂模式
class Point{

}

class PointFactroy{//解决了构造函数时的问题
    public static  Point makePointByxy(double x,double y){
        Point p = new Point();
        //通过x 和 y 给 p进行属性设置
        return p;
    }

    public static Point makePointByra(double r,double a){
        Point p = new Point();
        //通过r 和 a给 p进行属性设置
        return p;
    }
}
public class Demo34 {
    public static void main(String[] args) {
        Point p = PointFactroy.makePointByxy(10,20);
    }
}
